﻿using System;

namespace ExFlash.Records
{
    public abstract class SoundData : ISwfSerializable
    {
        private readonly int _soundDataLen;
        
        public Byte[] Data
        {
            get;
            protected set;
        }

        protected SoundData(int soundDataLen)
        {
            _soundDataLen = soundDataLen;
        }
        
        #region ISwfSerializable Members

        public virtual void SwfDeserialize(BinaryBitReader reader)
        {
            Data = new Byte[_soundDataLen];
            reader.Read(Data, 0, _soundDataLen);
        }

        public abstract void SwfSerialize(byte[] arr, ref int offset);

        #endregion
    }
}
